import axios from "@/utils/http"


//按id查询课程
export function getClassById(id:any){
    return axios({
        url:`/fore/class/findDetail/${id}`,
        method:"get"
    })
}

//按id查询课程下的所有视频
export function getvideo(id:any){
    return axios({
        url:`/fore/video/findByClassId`,
        method:"get",
        params:{
            classId:id
        }
    })
}

//按id查询课程下的所有视频
export function getOnevideo(id:any){
    return axios({
        url:`/fore/video/findById`,
        method:"get",
        params:{
            id:id
        }
    })
}


//添加课程评论
export function addRemark(remark:any){
    return axios({
        url:`/fore/remark/add`,
        method:"post",
        headers:{
            "Content-Type":"application/json"
        },
        data:{
            "classId": remark.classId,
            "content": remark.content,
            "rating": remark.rating
        }
    })
}


//删除课程评论
export function delRemark(id:any){
    return axios({
        url:`/fore/remark/delete`,
        method:"post",
        headers:{
            "Content-Type":"application/json"
        },
        data:{
            "classId": id,
        }
    })
}


//显示课程评论
export function showRemark(id:any,limit:any,page:any){
    return axios({
        url:`/fore/remark/findByClassId`,
        method:"post",
        headers:{
            "Content-Type":"application/json"
        },
        params:{
            "classId": id,
            "limit":limit,
            "page":page
        }
    })
}


